

        var toTop = href = null;
        var reference = start = 0;
        var judge = null;
        var picAnimateDelay = null;
        var times;
        window.onscroll = function(){
            if(!this.toTop) return false; 
            window.scrollTo(0, reference - reference / times * start) 
        }
        function backToTop(){
            reference = Math.round(document.documentElement.scrollTop || document.body.scrollTop);
            var step = reference / times;
            console.log(reference);
            toTop = setInterval(function(){
                console.log('c');
                if(start == times -1){
                    document.documentElement.scrollTop = document.body.scrollTop = 0;
                    start = 0
                    clearInterval(toTop);
                    toTop = null;
                }
                var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
                
                var after = scrollTop - step;
                document.documentElement.scrollTop = document.body.scrollTop = after;
                start++;
                
            },10)
        }
       
        function prevOrNext(className){
            var current = $('.choosePage .current')[0].ind;
            if(className.indexOf('prev') >= 0){
                if($('.choosePage>a.current').prev()[0] == $('.choosePage .prev')[0] || $('.choosePage>a.current').prev()[0] == $('.choosePage .ellipsis')[0]) return false;
                $('.choosePage>a.current').removeClass('current');
                console.log('current');
                $('.choosePage>a:eq(' + (current - 1) + ')').addClass('current');
            }else{
                if($('.choosePage>a.current').after()[0] == $('.choosePage .next')[0] || $('.choosePage>a.current').after()[0] == $('.choosePage .ellipsis')[0]) return false;
               
                $('.choosePage>a.current').removeClass('current');
                $('.choosePage>a:eq(' + (current + 1) + ')').addClass('current');
            }
        }
        $(document).ready(function(){
            times = browserRedirect()?250:150;
            for(var p = 0;p < $('.choosePage>a').length;p++){
                $('.choosePage>a')[p].ind = p;
            }
            $('.choosePage>a').click(function(){
                console.log($(this)[0]);
                if($(this)[0].className.indexOf('ellipsis') >= 0) return false;
                $('.contn .box').removeClass('current');
                
               
                if($(this)[0].className.indexOf('line') >= 0){
                    prevOrNext($(this)[0].className);
                }else{
                    $('.choosePage>*').removeClass('current');
                    $(this).addClass('current');
                }
                backToTop();
            })
        })